/*
 * FavourableMessageListItem.java
 * business
 *
 * Created by ChenTao on 2017/1/9.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.yidiandao.business.R;
import com.yidiandao.business.ui.messageabout.favorable.FavourableMessageActivity;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.FavorableMessageHolder;
import com.yidiandao.business.utils.UmengUtils;

/**
 * 优惠促销-ListItem
 */
public class FavourableMessageListItem extends DisplayListItem<FavorableMessageHolder, Integer> {

    public FavourableMessageListItem(Integer messageBean) {
        super(messageBean);
    }

    @Override
    public void onShow(final Context context, FavorableMessageHolder holder) {
        holder.refreshUnReadCount(data);
        holder.rootLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                UmengUtils.onEvent(context, R.string.umeng_message_favorable);
                FavourableMessageActivity.actionStart((Activity) context);
            }
        });
    }

    @Override
    public String getDisplayItemTag() {
        return FavourableMessageListItem.class.getSimpleName();
    }

    @Override
    public Class<FavorableMessageHolder> getViewHolderClazz() {
        return FavorableMessageHolder.class;
    }
}
